<template>
    <div>
        <h2>{{name}}-{{counter}}</h2>
        <button @click="changeCounterHome">Home+1</button>
    </div>
</template>

<script>
    import { inject } from 'vue';
    export default {
        setup() {
            const name = inject('name');
            const counter = inject('counter');

            const changeCounterHome = () => {
                counter.value++
            }

            return {
                name, 
                counter,
                changeCounterHome
            }
        }
    }
</script>

<style scoped>

</style>